package com.yourenbang.lingyun.transaction.mapper;

import com.yourenbang.lingyun.transaction.web.domain.po.FundAccountChangePlan;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface TransactionFundAccountChangePlanMapper {

    /**
     * 插入
     */
    int insert(FundAccountChangePlan plan);

    /**
     * 更新
     */
    int updateById(FundAccountChangePlan plan);

    /**
     * 通过订单号获取
     */
    FundAccountChangePlan getByOrderId(@Param("platNo")Short platNo, @Param("orderId") String orderId);

    FundAccountChangePlan getById(@Param("platNo")Short platNo, @Param("fundAccountChangePlanId") Integer fundAccountChangePlanId);

    /**
     *
     *查询plan通过流水类型和change状态
     */
    List<FundAccountChangePlan> getByJournalTypeAndStatus(@Param("platNo") Short platNo,
                                                          @Param("accountJournalType") Integer accountJournalType,
                                                          @Param("accountChangePlanStatus") Short accountChangePlanStatus);


    List<FundAccountChangePlan> getByJournalTypeAndStatusByTypeList(@Param("platNo") Short platNo,
                                                          @Param("accountJournalTypeList") List<Integer> accountJournalTypeList,
                                                          @Param("accountChangePlanStatus") Short accountChangePlanStatus);

    /**
     * 更新change状态为changed
     */
    int updateWaitChanged(@Param("platNo")Short platNo, @Param("orderId") String orderId);

}